/**
 * Created by 000188 on 2016/6/27.
 */
let webpack = require('webpack');
let devServer = require('webpack-dev-server');
let webpackConfig = require('./webpack.config');
let open = require('open');


webpackConfig.entry.index.unshift("webpack-dev-server/client?http://localhost:8088", "webpack/hot/only-dev-server");
webpackConfig.output.publicPath = 'http://localhost:8088/';

webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
webpackConfig.plugins.shift();
webpackConfig.plugins.shift();

let server = new devServer(webpack(webpackConfig),{
    hot: true
});

server.listen('8088',()=>{
    open('http://localhost:8088/index');
});